package com.nc.delivery_project.shared.servicelocator;

import com.google.web.bindery.requestfactory.shared.ServiceLocator;
import com.nc.delivery_project.server.service.RoleService;

/**
 * Created by miroshnik on 12/28/2014.
 */
public class RoleServiceLocator implements ServiceLocator {

    private static RoleService serviceInstance;

    @Override
    public Object getInstance(Class<?> aClass) {
        return getServiceInstance();
    }

    private static RoleService getServiceInstance() {
        if (serviceInstance == null) {
            serviceInstance = new RoleService();
        }

        return serviceInstance;
    }
}
